package border;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import square.Direction;
import square.NormalSquare;

public class WallTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		
	}


	@Before
	public void setUp() throws Exception {
		square1 = new NormalSquare();
		square2 = new NormalSquare();
		isSlipperyWall = false;
		directionOfBorder = Direction.NORTH;
	}
	
	@Test
	public void constructorTest_OneSquareCase(){
		Wall wall = new Wall(square1, directionOfBorder, isSlipperyWall);
		assertFalse(wall.isSlippery());
		assertFalse(wall.isTerminated());
		assertFalse(wall.isSlippery());
		assertEquals(square1.getBorder(directionOfBorder), wall);
	}
	
	@Test
	public void constructorTest_TwoSquaresCase(){
		 Wall wall = new Wall(square1, square2, directionOfBorder, isSlipperyWall);
		 assertFalse(wall.isSlippery());
		 assertFalse(wall.isTerminated());
		 assertFalse(wall.isSlippery());
		 assertEquals(square1.getBorder(directionOfBorder), wall);
		 assertEquals(square2.getBorder(directionOfBorder.getOpposite()), wall);
		 
	}
	
	private NormalSquare square1;
	private NormalSquare square2;
	private boolean isSlipperyWall;
	private Direction directionOfBorder;
}
